using micromsg;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Protocol;
using MicroMsg.Scene;
using System;
namespace MicroMsg.Plugin.Sns.Scene
{
	public class NetSceneSnsDetail : NetSceneBaseEx<SnsObjectDetailRequest, SnsObjectDetailResponse, SnsObjectDetailRequest.Builder>
	{
		private const string TAG = "NetSceneSnsComment";
		private ulong mObjectID;
		public bool doScene(ulong objectID)
		{
			this.mObjectID = objectID;
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
			this.mBuilder.Id = objectID;
			this.mSessionPack.mCmdID = 101;
			base.endBuilder();
			return true;
		}
		protected override void onFailed(SnsObjectDetailRequest request, SnsObjectDetailResponse response)
		{
			Log.smethod_1("NetSceneSnsComment", "send request failed");
		}
		protected override void onSuccess(SnsObjectDetailRequest request, SnsObjectDetailResponse response)
		{
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				Log.smethod_1("NetSceneSnsComment", "send request failed ret =" + ret);
				if ((RetConst)1 == ret)
				{
					EventCenter.postEvent(EventConst.ON_NETSCENE_SNS_GETDETAIL_ERR, this.mObjectID, null);
				}
				return;
			}
			SnsInfoMgr.update(response.Object);
		}
	}
}
